
import 'package:flutter/material.dart';
import 'package:keep_account/ui/user_profile.dart';
import 'package:keep_account/ui/work_records.dart';

class HomeMain extends StatefulWidget {
  const HomeMain({super.key});


  @override
  State<StatefulWidget> createState() => _HomeMainState();
}

class _HomeMainState extends State<HomeMain> with SingleTickerProviderStateMixin{

  late TabController controller = TabController(length: 2, vsync: this);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: TabBarView(
        controller: controller,
        children: const [
          WorkRecordsPage(),
          UserProfile()
        ],
      ),
      bottomNavigationBar: Material(
        color: Colors.white,
        child: TabBar(
          controller: controller,
          tabs: const [
            Tab(
              text: "工作记录",
              icon: Icon(Icons.align_vertical_bottom),
            ),
            Tab(
              text: "我的",
              icon: Icon(Icons.account_box),
            )
          ],
        ),
      ),
    );
  }
}